Desde hace tiempo, me gusta centralizar los logs en una sola máquina…. por ejemplo, donde tengo el nagios.
la máquina base es una debian jessie pelada y instalamos el syslog-ng:
apt-get install syslog-ng
Y ahora modificamos el fichero /etc/syslog-ng/syslog-ng.conf
options { chain_hostnames(yes); flush_lines(0); use_dns(no); use_fqdn(no);
owner("root"); group("adm"); perm(0640); stats_freq(0);
create_dirs(yes); bad_hostname("^gconfd$");
};
########################
# Sources
########################
# This is the default behavior of sysklogd package
# Logs may come from unix stream, but not from another machine.
#
source s_src {
system();
internal();
};
# If you wish to get logs from remote machine you should uncomment
# this and comment the above source line.
#
#source s_net { tcp(ip(127.0.0.1) port(1000)); };
source syslog_udp {
udp(port(514));
};
.
.
.
.
.
# Debian only
destination d_ppp { file("/var/log/ppp.log"); };
# Destí logs Mikrotiks
destination clientslogs {
file("/var/log/logscraem/$YEAR$MONTH$DAY/$HOST.auth");
};
.
.
.
.
log {
source(syslog_udp);
destination(clientslogs);
};
Nos crearemos un directorio por día y un fichero por dispositivo.
Reiniciamos el syslog-ng y listo.